package com.ysz.timewheel.server.threadpool;

import com.ysz.timewheel.Starter;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @ClassName ThreadPool
 * @Description TODO
 * @Data 15:53
 * @Version 1.0
 * @Author ysz
 */
public class ThreadPool {

    /**
     * 循环处理客户端任务的线程池  定义为3个  消费一个队列  因为涉及到park30秒所以相对于多线程加锁对队列的访问消耗来说
     * 还是多线程好一些
     */
    public static final ExecutorService workerService = Executors.newFixedThreadPool(3);
    /**
     * 启动线程数量为2  负责启动轮询扫描失活map和轮询扫描超时map
     */
    public static final ExecutorService starterService = Executors.newFixedThreadPool(2);
    /**
     * 模拟多客户端访问
     */
    public static final ExecutorService clientService = Executors.newFixedThreadPool(Starter.clientsNode.length);
}
